package com.example.selectdorm.service;

import com.example.selectdorm.entity.CheckIn;
import com.example.selectdorm.repo.CheckInRepository;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class CheckInService {
    private final CheckInRepository checkInRepository;

    public void addCheckIn(CheckIn checkIn){
        checkInRepository.save(checkIn);
    }

    public Boolean isCheckedIn(Long uid) {
        return checkInRepository.findByUid(uid).isPresent();
    }
}
